package com.cloudalibabagateway11001.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: TODO
 * @Author zx
 * @Date 2024/12/2 17:22
 * @Version 1.0
 */
//@Configuration
public class GateConfig {


//    @Bean
//    public RouteLocator routes(RouteLocatorBuilder builder) {
//
//        // 路由规则
//        RouteLocatorBuilder.Builder routes = builder.routes();
//        // 具体路由地址
//        routes.route("path_route_zx1", r -> r.path("/nacos-9001/**")
//                .uri("http://localhost:9001/nacos-provider-9001")).build();
//
//        routes.route("path_route_zx2", r -> r.path("/nacos-9002/**")
//                .uri("http://localhost:9002/nacos-provider-9002")).build();
//        // 返回所有路由规则
//        return routes.build();
//    }

}
